package com.shadow.ui.map.stage.base
{
	import com.liseen.resource.ResourcePool;
	import com.shadow.manager.UIManager;
	import com.shadow.resourceConfig.ResourceConfig;
	import com.shadow.ui.container.top.base.TopContainer;
	import com.shadow.ui.custom.CustomSprite;
	import com.shadow.ui.interfaces.IMemoryCleaner;
	import com.shadow.ui.map.stage.EditorMapStage;
	import com.shadow.ui.map.stage.MissionMapStage;
	import com.shadow.utils.Util;
	
	import flash.display.MovieClip;
	import flash.events.Event;

	/**
	 *抽象基类不能被实例化 
	 * @author Liseen
	 * 
	 */	
	public class MapStage extends CustomSprite implements IMemoryCleaner
	{
		public var topConatainer:TopContainer;
		
		protected var baseMapClip:MovieClip;
		
		public function MapStage(self:MapStage)
		{
			super();
			if(self!=this){
				throw new Error("抽象类类不能被直接实例化");
			}
			
			this.initialize();
			this.setLayout();
			this.addEvent();
			
		}
		
		public function dealloc():void
		{
		}
		
		public function removeEvent(event:Event):void
		{
			
		}
		/**
		 *清除鼠标经过操作 
		 * 
		 */		
		public function clearMouseMoveOperation():void
		{
			
		}
		
		/**
		 *初始化 
		 * 
		 */		
		private function initialize():void
		{
				
		}
		/**
		 *将基础的舞台背景添加到显示列表中 
		 * 
		 */		
		private function setLayout():void
		{
			if((Util.isset(baseMapClip)==false)&&(!(this is EditorMapStage))&&(!(this is MissionMapStage))){
				var baseMapClipDef:Class = ResourcePool.getClass(GlobalContext.RESOURCE_PATH+ResourceConfig.UI_LIB_URL,"BaseMapClip") as Class
				this.baseMapClip = new baseMapClipDef() as MovieClip;
				this.addChild(this.baseMapClip);
				UIManager.MAP_RECTANGLE = this.baseMapClip.getBounds(this.baseMapClip);
			}
			
			x = UIManager.MAP_CENTER_POINT_X;
			y = UIManager.MAP_CENTER_POINT_Y;
			
			if (false == (this is MissionMapStage))
			{
				UIManager.hideLoadingPage();
			}
		}
		
		private function addEvent():void
		{
			
		}
	}
}